/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package za.ac.cput.mphokazi.designpatterns.part1.structural.adapterPattern;


/**
 *
 * @author mphokazi
 */
public class TemperetureObjectReporter implements TemperatureInfo {
    
    
    CelciusRepoter celciusRepoter;
    public TemperetureObjectReporter(){
        celciusRepoter =new CelciusRepoter();
    }

    @Override
    public double getTemperatureInf() {
        return cToF(celciusRepoter.getTemperature());
    }

    @Override
    public void setTemperatureInf(double temperature) {
        celciusRepoter.setTemperature(fToC(temperature));
    }

    @Override
    public double getTemperatureInc() {
        return celciusRepoter.getTemperature();
    }

    @Override
    public void setTemperatureInc(double temperature) {
        celciusRepoter.setTemperature(temperature);
    }
    
    
    
    
    private double fToC(double f){
        
        return ((f-32)*5/9);
    }
    private double cToF(double c){
        return ((c*9/5)+32);
    }
    }
 
  
    

